<?php

namespace app\model;

class DictTypeModel extends BaseModel
{
    /**
     * 与模型关联的表名
     *
     * @var string
     */
    protected $table = 'dict_type';

    /**
     * 属性转换
     *
     * @var array
     */
    protected $casts = [
        'status' => 'integer',
        'created_at' => 'datetime:Y-m-d H:i:s',
        'updated_at' => 'datetime:Y-m-d H:i:s',
    ];

    /**
     * 关联字典数据
     */
    public function dictData()
    {
        return $this->hasMany(DictModel::class, 'dict_type', 'dict_type');
    }
}